package com.navinfo.platform.dataanalysis.dto.condition;

import com.navinfo.platform.common.dto.DataInfo;
import lombok.Data;

@Data
public abstract class AbstractCondition implements ICondition {

    protected boolean lastPoint;
    protected String[] param;
    @Override
    public boolean condition(DataInfo dataInfo, Object... externalParam){
        Object param1 = externalParam[0];
        Integer diffDuration = Integer.parseInt(String.valueOf(param1));
        return subCondition(dataInfo) && diffDuration <= 120;
    }

    protected abstract boolean subCondition(DataInfo dataInfo, Object... externalParam);
}
